package com.stlm2.dems.entity;

/**
 * 商品状态
 */
public enum InventorySource {
    Init(1) {
        public String toString() {
            return "采购";
        }
    },
    Modification(2) {
        public String toString() {
            return "线下核销";
        }
    },
    PurchaseOrder(3) {
        public String toString() {
            return "订单购买";
        }
    },
    OrderCancel(4) {
        public String toString() {
            return "取消订单";
        }
    },
    OrderReject(5) {
        public String toString() {
            return "驳回订单";
        }
    },
    Adjusting (6) {
        public String toString() {
            return "自营调货";
        }
    },
    InventoryCheck (7) {
        public String toString() {
            return "库存盘点";
        }
    };

    private final int val;

    InventorySource(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static InventorySource getByIntValue(int n) {
        switch (n) {
            case 1:
                return Init;
            case 2:
                return Modification;
            case 3:
                return PurchaseOrder;
            case 4:
                return OrderCancel;
            case 5:
                return OrderReject;
            case  6:
                return  Adjusting;
            case  7:
                return InventoryCheck;
            default:
                return null;
        }
    }
}
